{
<?php if($stat == 'ok'): ?>
 "books": {
  "page": "<?php echo $page ?>",
  "perpage": "<?php echo $perpage ?>",
  "pages": "<?php echo $pages ?>",
  "total": "<?php echo $total ?>",
  "search_term": "<?php echo $search_term ?>",
<?php include_partial('list', array('books' => $books)); ?>
  },
<?php else: ?>
 "code": "<?php echo $error_code ?>",
 "message": "<?php echo $error_msg ?>",
<?php endif; ?>
 "stat": "<?php echo $stat ?>"
}